#ifndef FND_CAR_AGGREGATE_H
#define FND_CAR_AGGREGATE_H
#include "iaggregate.h"
#include <boost/ptr_container/ptr_map.hpp>
#include <boost/noncopyable.hpp>
#include <string>
class aggregate_manager : boost::noncopyable {
public:
    void add(const std::string& name, IAggregate* i) {
        std::string r(name) ;
        m_container.insert(r, i) ;
    }
    IAggregate* get(const std::string& name) {
        return &m_container[name] ;
    }
private:
    aggregate_manager() {}
public:
    static aggregate_manager& instance() ;
private:
    boost::ptr_map<std::string, IAggregate> m_container ;
} ;
#endif
